import React from 'react';
import Button from './button'
class List extends React.Component {
  del(id) {
    console.log("点击了删除")
    this.props.onDel(id)
  }
  render() {
    let { list, render123 } = this.props;
    return <ul className=''>
      {
        list.map(item => <li key={item.id}>{
          render123 ? render123(item) : item.value
        } <Button onClick={() => { this.del(item.id) }}><b>X</b></Button></li>)
      }
    </ul>;
  }
}
export default List